macos: implement GL context
authorChristian Hergert <chergert@redhat.com>
Thu, 29 Oct 2020 17:33:22 +0000 (10:33 -0700)
committerChristian Hergert <chergert@redhat.com>
Thu, 29 Oct 2020 17:57:02 +0000 (10:57 -0700)
commitde9c9efa6fbb23db2955357d8ea599d52ed12434
tree2810d0e0cc53299e3739aadca2447b902d8bd02b
parenteb809ba42547f098f5cb1d916b525cf0c8c384c1
macos: implement GL context

This implements the basics for a GdkGLContext on macOS. Currently, rendering
only is fully working for the GskCairoRenderer case where we read back pixels
into a cairo surface for rendering. More work on synchronization is required for
the GL on GskGLRenderer case.

When we attempt to render a surface itself with GL, the context will ensure that
the new GdkMacosGLView is placed within the NSWindow. In other cases, we
use a dummy NSView and NSWindow for backing the NSOpenGLContext to
ensure that we can get accelerated drawing.

This gets GtkGLArea working when running with GSK_RENDERER=cairo.
gdk/macos/GdkMacosGLView.c [new file with mode: 0644]
gdk/macos/GdkMacosGLView.h [new file with mode: 0644]
gdk/macos/gdkmacosglcontext-private.h
gdk/macos/gdkmacosglcontext.c
gdk/macos/meson.build